web3.js web3.eth.getGasPrice
code:getGasPrice.js
web3.eth.getGasPrice(callback)
現在の gas price を返します。
この gas price は過去数ブロックの gas price の中央値により決定されます。
戻り値
String を返す Promise
現在の gas price
文字列型の数値
単位はwei
巨大な数字を JavaScript で扱う際の注意事項を参照してください。
サンプル
code:example.js
web3.eth.getGasPrice()
.then(console.log);
"20000000000"
原文
http://web3js.readthedocs.io/en/1.0/web3-eth.html#getgasprice
#web3.js #web3.js@1.0
web3.js 日本語 API リファレンス